package com.hzhc.task;

import com.hzhc.entity.YwOrder;
import com.hzhc.service.*;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度
 *
 * @author 功不唐捐
 * @since 2024-09-25
 */
@Component("schedulerTask")
@RequiredArgsConstructor
public class SchedulerTask {
    private final TrainPlanCityService trainPlanCityService;
    private final DpMapDataService dpMapDataService;
    private final YwOrderService ywOrderService;

    public void countMapData() {
        //统计完成量
        dpMapDataService.updateFinishTotal();
        // 班列统计分析
        dpMapDataService.updateTrainPlanTotal();
        // 在场箱统计
        dpMapDataService.updateYardCntrTotal();
        // 班列站点统计分析
        dpMapDataService.updatePortTotal();

        //航线
        trainPlanCityService.updateCityCntr();
    }

    public void finishYwOrder() {
        //自动完成
        ywOrderService.autoFinishYworder();
    }
}
